//
// File:	GameRuleManager.hpp
// Author:	Thomas TISSOT-DUPONT
// Login:	<thomas.tissotdupont@free.fr>
//
// Created:	23/04/2010 at 22:58:26
// Purpose:	
//
#ifndef GAMERULEMANAGER_HPP
#define GAMERULEMANAGER_HPP

#include <map>
#include "IGameRuleManager.hpp"

class GameRuleManager : public IGameRuleManager
{
public:
												GameRuleManager();
												~GameRuleManager();

public:
	void										InstallGameRule(const std::string &name, pfnGameRuleFactory factory);

public:
	bool										HasGameRule(const std::string &name) const;
	bool										StartGameRule(const std::string &name);
	void										StopGameRule();
	IGameRule									*GetCurrentGameRule() const;

public:
	void										Update();

public:
	void										SetEngine();

private:
	std::map<std::string, pfnGameRuleFactory>	m_gameruleFactories;
	IGameRule									*m_pCurrentGameRule;
};

#endif //!GAMERULEMANAGER_HPP
